import os
from multiprocessing import Process,Queue

def worker(name):
    print(f"{name} start to worker process id :{os.getpid()},father pid ={os.getppid()}")
    print(f"hello{name}")




if __name__ == "__main__":
    print(f"主进程信息:pid={os.getpid()}")
    ps = Process(target=worker,args=("你好",))
    print(f"before start:{ps.is_alive()}")
    ps.start()
    print(ps.is_alive())
    ps.join()  # 阻塞式的等待
    print(f"主进程信息:pid={os.getpid()},ppid={os.getppid()}")